package com.fbinggun.sql;

public class Formula {
    //列名
    String ColumnName;
    //类型
    String Type;
    int Length = 0;

    public Formula(String columnName, String type, int length) {
        ColumnName = columnName;
        Type = type;
        Length = length;
    }

    public Formula(String columnName, String type) {
        ColumnName = columnName;
        Type = type;

    }


    @Override
    public String toString() {
        if (Length == 0) {
            String x = "`" + ColumnName + "` " + Type;
            return x;
        } else {
            String x = "`" + ColumnName + "` " + Type + "(" + Length + ")";
            return x;
        }
    }
}